package com.lsk.game.model;

import com.lsk.game.enums.Identity;

import java.util.*;

public class Game {
	private static final Map<Integer, Identity> map6 = new HashMap<>();
	private List<User> players = new ArrayList<>();
	private List<User> players2;
	public Game(){
		map6.put(1,Identity.WEREWOLF);
		map6.put(2,Identity.WEREWOLF);
		map6.put(3,Identity.SEER);
		map6.put(4,Identity.GUARD);
		map6.put(5,Identity.VILLAGER);
		map6.put(6,Identity.VILLAGER);
		List<Integer> ints = new ArrayList<>();
		for (int i = 1; i < 7; i++) {
			ints.add(i);
		}
		Collections.shuffle(ints);
		for(Integer i : ints){
			User user = new User(i,map6.get(i));
			players.add(user);
		}
		players2 = new ArrayList<>(players);
	}
	public User getPlayer(Integer playerID){
		User player =  players2.get(playerID);
		players2.remove(playerID);
		return player;
	}
}
